package dao.impl;

import dao.IGoodsSortDao;
import model.GoodsSort;
import org.apache.ibatis.session.SqlSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @aythor:侯仪澳
 * @data:2022/7/25
 */
@Repository
public class GoodsSortDao implements IGoodsSortDao {
    @Autowired
    private SqlSession sqlSession;
    String url = "dao.IGoodsSortDao.";

    //查询分类
    @Override
    public List<GoodsSort> queryGoodsSort(GoodsSort goodsSort) {
        return sqlSession.selectList(url+"queryGoodsSort",goodsSort);
    }

    //添加分类
    @Override
    public int addGoodsSort(GoodsSort goodsSort) {
        return sqlSession.insert(url + "addGoodsSort",goodsSort);
    }

    //删除分类
    @Override
    public int del(Integer id) {
        return sqlSession.delete(url + "del",id);
    }
}
